import { IMOptionsType } from "@/types/dict";
import { IMTableType } from "@/types/table";
import { DrawerFormStateType } from "./type";
import baseStyle from "@layout/header/style/base.module.less";
export const columns = reactive<IMTableType[]>([
  { title: getProxyT("base.index"), dataIndex: "index", key: "index" },
  {
    title: getProxyT("table125"),
    dataIndex: "member_name",
    key: "member_name",
  },
  {
    title: getProxyT("table126"),
    dataIndex: "order_number",
    key: "order_number",
  },
  {
    title: getProxyT("table0"),
    dataIndex: "user_info",
    key: "user_info",
  },
  {
    title: getProxyT("table2"),
    dataIndex: "phone_number",
    key: "phone_number",
  },
  {
    title: getProxyT("table13"),
    dataIndex: "channel_name",
    key: "channel_name",
  },
  {
    title: getProxyT("table127"),
    dataIndex: "payment_time",
    key: "payment_time",
  },
  {
    title: computed(() => `${$t("table128")}(USDT)`),
    dataIndex: "amount",
    key: "amount",
  },
  {
    title: getProxyT("table129"),
    dataIndex: "expire_time",
    key: "expire_time",
    customRender: ({ text }: any) => getTimeByZone(text),
  },
  { title: getProxyT("table132"), dataIndex: "status", key: "status" },
  { title: getProxyT("base.action"), key: "action" },
]);
export const colorOptions = reactive<any>({
  1: "s-52c41a",
  2: "s-ffc107",
  3: "s-dc3545",
});
export const sexIconOptions = reactive<any>({
  1: "icon-nan2",
  2: "icon-nv2",
  3: "icon-xingbie",
});
export const sexColorOptions = reactive<any>({
  1: baseStyle.blueBase,
  2: "#ff5050",
  3: "#333333",
});
export const orderStatusOptions = reactive([
  { value: 1, label: getProxyT("dict33") },
  { value: 2, label: getProxyT("dict15") },
  { value: 3, label: getProxyT("dict34") },
]);
export const channelOptions = ref<IMOptionsType[]>([]);
export const searchList = ref([
  {
    label: getProxyT("table126"),
    type: "input",
    model: "order_number",
    allowClear: true,
    searchClass: "search-item-width-150",
    placeholder: getProxyT("placeholder141"),
    maxlength: 18,
  },
  {
    label: getProxyT("table13"),
    type: "select",
    model: "channel_id",
    placeholder: getProxyT("placeholder59"),
    searchClass: "search-item-width-150",
    options: channelOptions,
    allowClear: true,
  },
  {
    label: getProxyT("table139"),
    type: "input",
    model: "buy_user",
    allowClear: true,
    searchClass: "search-item-width-150",
    placeholder: getProxyT("placeholder120"),
  },
  {
    label: getProxyT("table127"),
    showTime: { format: "HH:mm:ss" },
    type: "rangePicker",
    model: "start_end",
    placeholder: computed(() => [$t("base.startDate"), $t("base.endDate")]),
    format: "YYYY-MM-DD HH:mm:ss",
  },
  {
    label: getProxyT("table132"),
    type: "select",
    model: "status",
    placeholder: getProxyT("placeholder61"),
    searchClass: "search-item-width-150",
    options: orderStatusOptions,
    allowClear: true,
  },
]);
export const operateType = ref<any>("");
export const drawerInstance = ref<any>(null);
export const drawerFormState = reactive<DrawerFormStateType<string>>({
  order_number: undefined,
  third_order_number: undefined,
  status: undefined,
  order_status: void 0,
  channel_name: undefined,
  phone_number: undefined,
  pay_type: undefined,
  create_time: undefined,
  origin_type: undefined,
  payment_time: undefined,
  user_info: {},
  dataSource: [],
});
export const drawerColumns = reactive<IMTableType[]>([
  { title: getProxyT("table130"), dataIndex: "level", key: "level" },
  {
    title: getProxyT("table125"),
    dataIndex: "member_name",
    key: "member_name",
  },
  {
    title: computed(() => `${$t("table131")}(USDT)`),
    dataIndex: "price",
    key: "price",
  },
  { title: getProxyT("table117"), dataIndex: "indate", key: "indate" },
  {
    title: getProxyT("table129"),
    dataIndex: "expire_time",
    key: "expire_time",
    customRender: ({ text }: any) => getTimeByZone(text),
  },
  { title: getProxyT("table132"), dataIndex: "status", key: "status" },
]);

export const indateOptions = reactive<IMOptionsType[]>([
  { value: 1, label: getProxyT("dict29") },
  { value: 2, label: computed(() => `1${$t("dict30")}`) },
  { value: 3, label: computed(() => `3${$t("dict30")}`) },
  { value: 4, label: getProxyT("dict32") },
]);
export const userDetailLoading = ref(false);
export const queryParams = reactive<any>({});
